home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ShareWare OnLine 2
/
ShareWare OnLine Volume 2 (CMS Software)(1993).iso
/
util2
/
sw_44b.zip
/
SW44DEMO.BAT
< prev
Wrap
DOS Batch File
|
1992-12-20
|
8KB
|
307 lines
@ECHO OFF
if not %1!==! goto %1
:REM A pre-SW screen just for effect
:REM make sure the screen is default white on black
:REM reset border
sw /o
:REM save existing prompt
set sav=%prompt%
:REM make sure there was room in environment
if not %sav%!==%prompt%! goto skip
set prompt=$e[0m$p$g
@echo on
cls
@echo off
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo Are Your Batch Files Dull?
echo.
echo Lifeless?
echo.
echo Boring?
echo.
echo SW.EXE is the answer!
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
pause
set prompt=%sav%
set sav=
:skip
:REM skip over screen definitions
:REM Put screen definitions at the beginning of the file for fastest execution
goto begin
:REM Screen definition with default label
:REM Windows are drawn in the order defined. Pause, Query and User Input will
:REM occur as they are encountered. SW will return only the last Query result.
:Display
_window /kcya┼ /r2 /s /bred /w /0 /z
SW.EXE - Expanded Text Handling!
/tWHI+ Multiple Windows!
/m v 4.4
_window /r10 /s /bwhi /gblu /l1 /fred /0
/tBLU Optional Command Line Syntax:
SW @filename [label]
_window /r16 /s /bwhi /gblu /l1 /fred /0
/tBLU SW 4.x ADDITIONAL FEATURES
/tred /─
/jl "- Define the entire screen with multiple windows "
using external text files.
_window /r25 /l0 /0 /p100- /d
" - Press any key for more - "
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- Using labels, more than one definition can be "
included in the same file.
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- The screen definition can be included inside the "
calling batch file!
_window /r19 /bwhi /gblu /l0 /jl /0 /p100-
"- SW can evaluate Environment Variables included "
inside screen definitions.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a1 /p100-
"- {NEW!} Highlighting can be a different color on "
/ered each line. Highlight blocks with{ {{braces}}}.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a2 /p100-
"- {BONUS!} SWV.EXE Text File Viewer available when "
registering SW / DI.
_window /r19 /bwhi /gblu /l0 /jl /0 /eblu+ /a3
"- {BONUS!} SW-DIR.EXE File Picker available when "
registering SW / DI.
_window /r25 /l0 /0 /p200- /d
" - Press any key to continue - "
:end_display
:REM screen definition showing a menu with user defined label
:Snd_menu
_window /kcya▐▄▀▄▀▄▀▌ /kCYA /r3 /s /bred /w /0 /z
SW.EXE - Sounds!
/m " v 4.4 "
_window /eRED /r11 /s /l1 /w
/mc ┤ Play a Sound ├
"~Low Tone ~Mid Tone ~High Tone"
"Bweep ~1 Bweep ~2 ~Bomb "
"~Siren ~Phasor ~Tweeter "
/tYEL /─
Close ~Encounters ~Charge
~WZLX
/m < {ESC} >
:end_Snd_menu
:REM screen definition showing a menu with another user defined label
:4.4
_window /r125 /c180 /z /bwhi /l0 /o
_window /kwhi┴───┬── /r4 /bred /w /0 /z /kblu /@-
SW.EXE - Bye, Bye ECHO!
/m v 4.4
_window /tRED /r11 /fWHI
They can also be placed anywhere on the screen they'll fit!
_window /c1 /r1 /tCYA /fBLU /bcya /l1 /0 /s1
Upper Left
_window /c71 /r1 /tMAG /fGRE /bmag /l1 /0 /s2
Upper Right
_window /c71 /r23 /tblu /fBLA /bgre /l1 /0 /s4
Lower Right
_window /c1 /r23 /tcya /fMAG /byel /l1 /0 /s3
Lower Left
_window /r18 /fWHI /tYEL+ /b4 /l5
(c) 1992 Warren Small
:end_4.4
:Charge
_window /aC4,2
_window /aF4,2
_window /aA4,2
_window /aC5,4
_window /aA4,2
_window /aC5,5
:End_Charge
:Close
_window /aA4,3
_window /aB4,3
_window /aG4,3
_window /aG3,3
_window /aD4,10
:End_Close
:WZLX
_window /aE5
_window /aG5
_window /aB5
_window /aE6
_window /aB5
_window /aG5
_window /aE5
:End_WZLX
:REM labels for Alert sounds demos near the beginning of file
:REM for faster execution
:beep1
sw /a1
goto BeepDemo
:beep2
sw /a2
goto BeepDemo
:beep3
sw /a3
goto BeepDemo
:beep4
sw /a4
goto BeepDemo
:beep5
sw /a5
goto BeepDemo
:beep6
sw /a6
goto BeepDemo
:beep7
sw /a7
goto BeepDemo
:beep8
sw /a8
goto BeepDemo
:beep9
sw /a9
goto beepdemo
:beep10
sw @sw44demo.bat charge
goto beepdemo
:beep11
sw @sw44demo.bat close
goto beepdemo
:beep12
sw @sw44demo.bat WZLX
goto beepdemo
:REM Alternate errorlevel check using FOR loop
:beepdemo
sw /q~lmh12bsptcew
for %%e in (1 2 3 4 5 6 7 8 9 10 11 12) do if errorlevel %%e goto beep%%e
if errorlevel 0 goto DI
:REM Command line examples, positioning, colors, shadows, pause, Wide edge
:REM Color numbers are used to shorten the line
:REM Command line cannot exceed 128 characters
:begin
sw /r125 /c180 /z /l0 " " /bwhi
sw /kwhi[_] /kred /r2 /s /bred "SW.EXE - Enhance Your Batch Files!" /0 /w /m " v 4.4 " /o /z
sw /r10 /l1 /bcya /fRED "In it's simplest form, SW displays your text" "in a window in the center of the screen."
sw /r18 /l3 /t11 "Display up to 50 lines" /t14 "- each with its own color -" /t12 "in one window!" /0
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
:REM More command line examples, justify, borders
sw /kcya░ /r2 /s /bred "SW.EXE - Add Color to Your BAT's!" /tYEL "So easy to use!" /w /0 /m " v 4.4 " /z
sw /fbla /byel /l4 /r10 "Other parameters allow different window colors," "double spacing, and 5 different borders" /2
sw /b7 /r19 /g4 /l "Clear the screen with color" "using an optional character for texture" "& make windows with shadows." /0 /s
sw /bwhi /r19 /gyel /l0 /0 /c4 /jl " Justify " " Text" " Left"
sw /bwhi /r19 /gyel /l0 /0 /c68 /jr " Justify " "Text " "Right "
sw /r25 /l0 /0 " - Press any key to continue - " /p100-
set colr=bla
:REM Make sure there was room in the environment
if not "%colr%"=="bla" goto next
:REM Another command line example, Query with default, Border Message, Draw
:REM Draw a full screen window
sw /r125 /c180 /o1 " "
sw /r3 /s /bred "SW.EXE - Flow Control for BAT's!" /w /0 /m " v 4.4 " /z
:REM The following line is longer than 128 characters BUT it works because
:REM when the line is processed by DOS, the %colr% variable is replaced by
:REM the color value making the command line 3 characters shorter.
:colors
sw /e12 /r13 /b%colr% /s /mc /t14 "▌ Pick a Color ▐" "~Brown ~Cyan ~White ~Green" "Press ~E~S~C to go on..." /q~bcwg /2 /l5 /d
if errorlevel 4 set colr=gre
if errorlevel 4 goto colors
if errorlevel 3 set colr=whi
if errorlevel 3 goto colors
if errorlevel 2 set colr=cya
if errorlevel 2 goto colors
if errorlevel 1 set colr=yel
if errorlevel 1 goto colors
:next
set colr=
:REM Display screen definition with default label
sw @sw44demo.bat
:REM Display screen definition in external file
sw @sw-44.new
:REM Display screen definition with label 'menu'
sw @sw44demo.bat Snd_menu
:REM Query is handled separately beacause I wanted to return to the menu
:REM after processing the response without redoing the screen.
:REM I also placed it nearer the top of the file to speed it up.
goto beepdemo
:REM create screen definition on the fly to demo DI.EXE
:DI
if exist di.hlp goto DI_Display
sw /r15 /l1 /0 /s /bwhi /fBLU /gblu "Standby!" "Building Next Screen"
echo :REM This file was created by SW44DEMO.BAT > di.hlp
echo :REM If simply viewing this file, Try the following command at the DOS prompt >> di.hlp
echo :REM "SW @DI.HLP" >> di.hlp
echo.>> di.hlp
echo :Display >> di.hlp
echo _window /kmag▒─┼─▒ /s /bred /r2 /0 /w >> di.hlp
echo SW.EXE - Now with DI!>> di.hlp
echo /mc v 4.4 >> di.hlp
echo _window /jl /s /0 /r9 >> di.hlp
echo /mc Disk Information >> di.hlp
echo.>> di.hlp
di >> di.hlp
echo. >> di.hlp
echo /m /eYEL "~╡ Press any key to continue ~╞">> di.hlp
echo _window /r25 /bblu /l0 /0 /p300- >> di.hlp
echo :End_Display >> di.hlp
:DI_Display
sw @di.hlp
:REM Display screen definition with label '4.4'
:final
sw @sw44demo.bat 4.4
for %%t in (10 9 8 7 6 5 4 3 2 1) do sw /r25 /l0 /0 /a10000,1 /p8- " - Pausing %%t seconds - " /@-
sw /r25 /l0 /0 /a60,1 /p2 " - Outta Here! - "
if exist sw-big.sw sw @sw-big.sw
:REM display help screen
:help
sw